using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.FIM
{
    using System;
    using System.Collections.Generic;

    [Table("fim_money_requests"), DataContract]
    //[Table("FimPayRequest"), DataContract]
    public class PayRequest
    {

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "MoneyReqId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("money_req_seq")]
        public int PayReqId { get; set; }

        [ForeignKey("MasBudgetSource")]
        [DataMember, Display(Name = "BgmSourceId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("bgm_source_seq")]
        public int BgSourceId { get; set; }

        [DataMember, Display(Name = "BgmYear", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("bgm_year")]
        public int BgYear { get; set; }

        [ForeignKey("WorkArea")]
        [DataMember, Display(Name = "WorkAreaId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("work_area_seq")]
        public Nullable<int> WorkAreaId { get; set; }

        [ForeignKey("MasBudgetExpenseGroup")]
        [DataMember, Display(Name = "BgExpGrpId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("bgm_exp_grp_seq")]
        public Nullable<int> ExpGrpId { get; set; }

        [ForeignKey("PayEvent")]
        [DataMember, Display(Name = "EventId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("event_seq")]
        public Nullable<int> PayEventId { get; set; }

        [DataMember, Display(Name = "MoneyReqDate", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("money_req_date")]
        public Nullable<System.DateTime> PayReqDate { get; set; }

        [DataMember, Display(Name = "UseAdvance", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("use_advance")]
        public string UseAdvance { get; set; }

        [ForeignKey("AdvanceBudgetSource")]
        [DataMember, Display(Name = "AdvanceBgmSourceId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("advance_bgm_source_seq")]
        public Nullable<int> AdvanceBgSourceId { get; set; }

        [DataMember, Display(Name = "RefNo", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("ref_no")]
        public string Code { get; set; }

        [DataMember, Display(Name = "DocRefNo", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("doc_ref_no")]
        public string DoccumentNo { get; set; }

        [DataMember, Display(Name = "MoneyReqName", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("money_req_name")]
        public string Name { get; set; }


        [ForeignKey("ProjectOperation")]
        [DataMember, Display(Name = "BgmProjOperId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("bgm_proj_oper_seq")]
        public Nullable<int> ProjOperId { get; set; }

        [ForeignKey("Employee")]
        [DataMember, Display(Name = "EmpId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("emp_seq")]
        public Nullable<int> EmpId { get; set; }

        [ForeignKey("JobSite")]
        [DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("job_site_seq")]
        public Nullable<int> JobSiteId { get; set; }

        [ForeignKey("MasContact")]
        [DataMember, Display(Name = "ContactId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("contact_seq")]
        public Nullable<int> ContactId { get; set; }

        [ForeignKey("DeliveryNote")]
        [DataMember, Display(Name = "IcmDnId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("icm_dn_seq")]
        public Nullable<int> DnId { get; set; }

        [DataMember, Display(Name = "BorrowNo", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("borrow_no")]
        public string BorrowNo { get; set; }

        [ForeignKey("BorrowType")]
        [DataMember, Display(Name = "BorrowTypeId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("borrow_type_seq")]
        public Nullable<int> BorrowTypeId { get; set; }

        [DataMember, Display(Name = "BorrowStartDate", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("borrow_start_date")]
        public Nullable<System.DateTime> BorrowStartDate { get; set; }

        [DataMember, Display(Name = "BorrowEndDate", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("borrow_end_date")]
        public Nullable<System.DateTime> BorrowEndDate { get; set; }

        [DataMember, Display(Name = "BorrowReturnDate", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("borrow_return_date")]
        public Nullable<System.DateTime> BorrowReturnDate { get; set; }

        [DataMember, Display(Name = "CreditCardNo", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("credit_card_no")]
        public string CreditCardNo { get; set; }

        //[ForeignKey("TransferType")]
        //[DataMember, Display(Name = "TransferTypeId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        //public Nullable<int> TransferTypeId { get; set; }

        //[ForeignKey("TransferJobSite")]
        //[DataMember, Display(Name = "TransferJobSiteId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        //public Nullable<int> TransferJobSiteId { get; set; }

        [DataMember, Display(Name = "Allow", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("allow")]
        public string Allow { get; set; }

        [ForeignKey("DebtorEmp")]
        [DataMember, Display(Name = "DebtorEmpId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("debtor_emp_seq")]
        public Nullable<int> DebtorEmpId { get; set; }

        [ForeignKey("DebtorContact")]
        [DataMember, Display(Name = "DebtorContactPersonId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("debtor_contact_seq")]
        public Nullable<int> DebtorContactId { get; set; }

        [ForeignKey("BidderCollateral")]
        [DataMember]
        [Column("bidder_col_id")]
        public int? BidderColId { get; set; }

        [ForeignKey("TransectionGroup")]
        [DataMember, Display(Name = "TranGrpId", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("tran_grp_seq")]
        public Nullable<int> TranGrpId { get; set; }

        [DataMember, Display(Name = "Remarks", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("remarks")]
        public string Remarks { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("record_status")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("created_by")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("created_when")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("updated_by")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MoneyRequestsResource))]
        [Column("updated_when")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual BGM.MasBudgetSource MasBudgetSource { get; set; }

        [DataMember]
		public virtual HRM.MasWorkArea WorkArea { get; set; }

        [DataMember]
        public virtual BGM.MasBudgetExpenseGroup MasBudgetExpenseGroup { get; set; }

        [DataMember]
		public virtual FIM.FimMasLookUp PayEvent { get; set; }

        [DataMember]
		public virtual BGM.MasBudgetSource AdvanceBudgetSource { get; set; }

        [DataMember]
        public virtual BGM.ProjectOperation ProjectOperation { get; set; }

        [DataMember]
        public virtual HRM.Employee Employee { get; set; }

        [DataMember]
		public virtual HRM.JobSite JobSite { get; set; }

        [DataMember]
        public virtual ICM.MasContact MasContact { get; set; }

        [DataMember]
        public virtual ICM.DeliveryNote DeliveryNote { get; set; }


        [DataMember]
        public virtual FIM.FimMasLookUp BorrowType { get; set; }

        //public virtual FIM.Transfer TransferType { get; set; }

        //public virtual HRM.JobSite TransferJobSite { get; set; }

        [DataMember]
		public virtual HRM.Employee DebtorEmp { get; set; }

        [DataMember]
		public virtual ICM.MasContact DebtorContact { get; set; }

        [DataMember]
        public virtual ACM.TransectionGroup TransectionGroup { get; set; }

        [DataMember]
        public virtual ICM.BidderCollateral BidderCollateral { get; set; }
    }
}